import { makeAutoObservable } from 'mobx';

class LogisticsStore {
  // 弹窗可见性
  isLogisticsPopupVisible = false;
  // 物流信息数据
  logisticsInfo: Array<{ context: string; ftime: string; time: string }> = [];

  constructor() {
    makeAutoObservable(this);
  }

  // 显示弹窗并设置物流数据
  showLogisticsPopup = (data: Array<{ context: string; ftime: string; time: string }>) => {
    this.logisticsInfo = data;
    this.isLogisticsPopupVisible = true;
  };

  // 隐藏弹窗
  hideLogisticsPopup = () => {
    this.isLogisticsPopupVisible = false;
  };
}

export const logisticsStore = new LogisticsStore();